<?xml version="1.0" encoding="UTF-8"?>
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	xmlns:pe="http://primefaces.org/ui"
	template="/WEB-INF/templates/business/buyer/template.xhtml"
>

	<f:metadata>
		<f:viewParam name="tradeId" value="#{tradeHome.id}"></f:viewParam>		
	   	<f:viewParam name="taskId" value="#{bpmHome.taskId}"></f:viewParam>
	   	<f:event listener="#{tradeHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:event listener="#{bestTradeEvaluationOfTradeList.initBestChooseEvaluation()}"	type="preRenderView" />
	</f:metadata>
	<ui:define name="buyer_header">
		<style type="text/css">
			.removeButton {
				float: right;
				margin-right: 20px;
			}
			
			.limitUnit {
				margin-top: 5px;
			}
			.closeBtn {
				float: right;
				background: url(#{resource['images/close2.png']}) 0 0 no-repeat;
				height: 22px;
				width: 22px;
				margin: 5px 12px 0 0;
			}
			.closeBtn:hover {
				background: url(#{resource['images/close2_hover.png']}) 0 0 no-repeat;
			}
			
			.col1 {
				width: 120px;
			}
			
			.col2 {
				width: 120px;
			}
			
			.col3 {
				width: 240px;
			}
		</style>
	</ui:define>
	<ui:define name="buyer_content">

		<h:form >
			<div class="iethbox_tit">
				<h2>材料评分</h2>			
			</div>
		
	   		<div class="iethbox_table">			
				<p:messages id="messages" closable="true">
		       		<p:autoUpdate />
		       	</p:messages>
				
				<h:panelGrid columns="3" columnClasses="col1, col2, col3" style="width: 480px;">
					<p:outputLabel for="offerScore" value="报价" />
					<p:outputPanel style="text-align: right;">
						<h:outputText value="#{tradeHome.instance.tradeReportData.offer}">
							<f:convertNumber maxFractionDigits="2" groupingUsed="true" />
						</h:outputText>
					</p:outputPanel>
					<p:inputNumber id="offerScore"
							  value="#{tradeHome.instance.tradeReportData.offerScore}"
						   required="true" 
						   decimalPlaces="2"
					   autocomplete="off" />
					
					<c:forEach items="#{tradeHome.instance.bulletin.defs}" var="_rd">
						<p:outputLabel for="bte_#{_rd.id}" value="#{_rd.requiredName}"></p:outputLabel>
						<p:outputPanel></p:outputPanel>
						<p:inputNumber id="bte_#{_rd.id}"
							  value="#{tradeHome.bestTradeEvaluationMap[_rd.id].score}"
						   required="true" 
						   decimalPlaces="2"
					   autocomplete="off" />
					</c:forEach>
					
				</h:panelGrid>
				
				<div style="margin: 10px;">
					<p:commandButton value="提交" action="#{tradeHome.assessBestChooseTrade()}" ajax="false"></p:commandButton>
					<p:button value="报名材料打包下载" href="/rest/trade/archive/#{tradeHome.instance.id}"></p:button>
					<p:button value="取消" outcome="BestChooseAudit.xhtml" includeViewParams="true">
						<f:param name="bulletinId" value="#{tradeHome.instance.bulletin.id}"></f:param>				
					</p:button>
				</div>			
				
			</div>	
		</h:form>		

	</ui:define>
</ui:composition>
